﻿Imports ScannerManager

Public Class Form1

    Private Sub btnScann_Click(sender As System.Object, e As System.EventArgs) Handles btnScann.Click

        Try

            'One line for scanning a document. Very easy :-)

            pictureBoxScann.Image = Scanner.Scan(ScannerQuality.Normal, FileExtension.Jpeg)

        Catch ex1 As ExceptionHandling.ScannerCancelPressedException
            MessageBox.Show(ex1.Message)
        Catch ex2 As ExceptionHandling.ScannerNoDeviceDetectedException
            MessageBox.Show(ex2.Message)
        Catch ex3 As ExceptionHandling.ScannerNotReadyException
            MessageBox.Show(ex3.Message)
        Catch ex4 As Exception
            MessageBox.Show(ex4.Message)
        End Try

    End Sub
End Class
